package de.lazy.gui.components;

import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;


class TabTransferable implements Transferable {
	private TabTransferData m_data;
	private DataFlavor flavor;
	String name;

	public TabTransferable(DraggableTabbedPane a_tabbedPane, int a_tabIndex, DataFlavor flavor, String name) {
		m_data = new TabTransferData(a_tabbedPane, a_tabIndex);
		this.flavor = flavor;
		this.name = name;
	}

	public Object getTransferData(DataFlavor flavor) {
		return m_data;
		// return DnDTabbedPane.this;
	}

	public DataFlavor[] getTransferDataFlavors() {
		DataFlavor[] f = new DataFlavor[1];
		f[0] = this.flavor;
		return f;
	}

	public boolean isDataFlavorSupported(DataFlavor flavor) {
		return flavor.getHumanPresentableName().equals(this.name);
	}		
}